//package com.qq.filter;
//
//import lombok.extern.slf4j.Slf4j;
//import org.apache.commons.lang.StringUtils;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.stereotype.Component;
//import org.springframework.web.servlet.HandlerInterceptor;
//
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.io.PrintWriter;
//
///**
// * @author Hpsyche
// */
//@Slf4j
//@Component
//public class GlobalInterceptor implements HandlerInterceptor {
//
//    @Override
//    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object obj) throws Exception {
//        System.out.println("zhongduanqi");
//        String secretKey = request.getHeader("from");
//        if(!StringUtils.isNotBlank(secretKey)||secretKey.equals("gateway")){
//            response.setContentType("application/json; charset=utf-8");
//            PrintWriter writer = response.getWriter();
//            writer.write("error");
//            return false;
//        }
//        return true;
//    }
//}